#include "Mydelay.h"

//全局变量，用于记录当前的时间
extern volatile uint32_t currentMillSeconds;

/*MyGetTick()是实时更新的嘛，当过期时间expireTime 大于实时时间就会继续运行while循环*/
void MyDelay(uint32_t Delay_ms)
{
	uint32_t expireTime = MyGetTick() + Delay_ms;
	while(expireTime > MyGetTick()){
	}
}

uint32_t MyGetTick(void)
{
	return currentMillSeconds;
}
